#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
	int n = 0;
	int flag = 0;
	int k = 0;
	int i = 0;
	scanf("%d", &n);
	for (i = 2; i < n; i++)
	{
		int x = 0;
		flag = 0;
		k = n - i;
		for (x = 2; x < i; x++)
		{
			if (i % x == 0)
			{
				flag = 1;
				break;
			}
		}
		if (flag == 0)
		{
			for (x = 2; x < k; x++)
			{
				if (k % x == 0)
				{
					flag = 1;
					break;
				}
				if (x == k - 1)
				goto yes;
			}
		}
		
	}
	yes:
	if (flag == 0)
	{
		printf("%d %d", i, k);
	}
}